package command.qxComm;

import command.Command;
import empty.power.Power;
import model.qxModel.PowerModel;
import server.ServerThread;

public class FindCommand extends Command {

    @Override
    public void excute() {
        PowerModel pm = new PowerModel();
        try {
            if (((Power)o).getFile_id()!=0)
            {   r = pm.selectFileID(((Power)o).getFile_id());}


            else if (((Power)o).getUser_id()!=0)
            {   r = pm.selectUserID(((Power)o).getUser_id());}

            else
            {   r = pm.selectAll();}

        } catch (Exception ex) {
            e = ex;
            throw new RuntimeException(ex);
        }
    }

    @Override
    public void excute(ServerThread st) {

    }
}
